/**
 * 这是一个用于构造自建类数组的文件
 */

public class ClassArr {
    public static void main(String[] args) {
        Man[] mans = new Man[3];
        mans[0] = new Man();
        mans[0].name = "John";
        mans[0].age = 10;
        mans[1] = new Man();
        mans[1].name = "Amy";
        mans[1].age = 9;
        mans[2] = new Man();
        mans[2].name = "OK";
        mans[2].age = 6;

        for (int i = 0; i < mans.length; i++) {
            System.out.println(mans[i].name + " " + mans[i].age);
        }

    }
}


class Man {
    public String name;
    public int age;
}